package com.lixueju.security.box.core.enums;

/**
 * 给客户端返回数据的枚举
 * @author lixueju
 * @since  2019/3/14 8:19
 */
public enum ResultDataEnum implements IEnum{
    // 系统的未知错误，Exception
    SUCCESS(0, "成功" ),
    FAIL(-1, "操作失败" ),

    AUTH_INVALID_TOKEN(40101, "无效的token"),
    AUTH_NONE_TOKEN(40102, "请登录后操作"),
    AUTH_NO_AUTHORITY(40103, "权限不足");

    /**
     * 枚举码
     */
    private final int code;
    /**
     * 枚举描述
     */
    private final String desc;

    ResultDataEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    @Override
    public int code() {
        return code;
    }

    @Override
    public String desc() {
        return desc;
    }
}
